﻿@model BrnMall.Manager.Domain.User.CashItem

@section header{
    <title>添加充值活动项目-充值活动</title>
    <link type="text/css" rel="stylesheet" href="/admin_store/css/site.css" />
    <script type="text/javascript" src="/admin_store/scripts/jquery.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/jquery.validate.unobtrusive.js"></script>
}

@section body{
    <h1 class="rightH1">
		微信小程序 &gt; 店铺管理 &gt; 充值活动 &gt; <span class="rightH1-cur">添加充值活动项目</span> 
        <div class="right">
            <a href="@Url.Action("list")" class="menuBT">返回列表</a>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </h1>

    @using (Html.BeginForm())
    {
        <div class="addTable">
            <table width="100%">

                <tr>
                    <td width="80px" align="right">活动主题：</td>
                    <td><input type="text" id="Title" name="Title" class="input" maxlength="30" style="width:300px;" /></td>
                </tr>
              
                <tr>
                    <td align="right">充值金额：</td>
                    <td><input type="number" id="Amount" name="Amount" class="input" maxlength="6" value="100" style="width:80px;"/>元 例如：充值100元，填写：100</td>
                </tr>
                <tr>
                    <td align="right">赠送金额：</td>
                    <td><input type="number" id="GiveAmount" name="GiveAmount" class="input" maxlength="6" value="0" style="width:80px;"/>元 例如：赠送10元，填写：10，客户充值金额大于或等于充值金额，才赠送。</td>
                </tr>
                <tr>
                    <td align="right">备注：</td>
                    <td><textarea  id="remark" name="remark" class="input" style="width:300px; height:50px;"></textarea></td>
                </tr>
                <tr>
                    <td align="right">&nbsp;</td>
                    <td>
                        <a href="javascript:" class="addBt" id="sumbitBut"><img src="/admin_store/images/submit.jpg" /></a>
                    </td>
                </tr>
                <tr>
                    <td align="right">&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            </table>
        </div>
        <script type="text/javascript">
            $(function () {
                $("#sumbitBut").click(function () { submits() });
            });

            function submits() {
                if ($("#Title").val() == "") {
                    Alert("请输入活动主题");
                    return false;
                }

                if ($("#Amount").val() == "") {
                    Alert("请输入充值金额");
                    return false;
                }
                if ($("#Amount").val() != "" && isNaN($("#Amount").val())) {
                    Alert("充值金额必须是数字");
                    return false;
                }

                if ($("#GiveAmount").val() == "") {
                    Alert("请输入赠送金额");
                    return false;
                }
                if ($("#GiveAmount").val() != "" && isNaN($("#GiveAmount").val())) {
                    Alert("赠送金额必须是数字");
                    return false;
                }

                $("form:first").submit();
                return false;
            }

            function Alert(msg) {
                alert(msg);
            }
        </script>
    }
}